import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/test'
        },

        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/table_api_key',
                    component: resolve => require(['../components/page/Table-apiKey.vue'], resolve),
                    meta: { title: 'api-key表格' }
                },
                {
                    path: '/table_images_public',
                    component: resolve => require(['../components/page/Table-images-public.vue'], resolve),
                    meta: { title: '公共镜像' }
                },
                {
                    path: '/table_images_private',
                        component: resolve => require(['../components/page/Table-images-private.vue'], resolve),
                    meta: { title: '私有镜像' }
                },
                {
                    path: '/container',
                    component: resolve => require(['../components/page/Container.vue'], resolve),
                    meta: { title: '容器管理' }
                },
                {
                    path: '/containerCreate',
                    component: resolve => require(['../components/page/ContainerCreate.vue'], resolve),
                    meta: { title: '创建容器' }
                },
                {
                    path: '/volume',
                    component: resolve => require(['../components/page/Volume.vue'], resolve),
                    meta: { title: '数据卷' }
                },
                // {
                //     path: '/table',
                //     component: resolve => require(['../components/page/BaseTable.vue'], resolve),
                //     meta: { title: '基础表格' }
                // },
                {
                    path: '/tabs',
                    component: resolve => require(['../components/page/Tabs.vue'], resolve),
                    meta: { title: '消息管理界面' }
                },
                // {
                //     path: '/form',
                //     component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                //     meta: { title: '基本表单' }
                // },
                // {
                //     // 富文本编辑器组件
                //     path: '/editor',
                //     component: resolve => require(['../components/page/VueEditor.vue'], resolve),
                //     meta: { title: '富文本编辑器' }
                // },
                // {
                //     // markdown组件
                //     path: '/markdown',
                //     component: resolve => require(['../components/page/Markdown.vue'], resolve),
                //     meta: { title: 'markdown编辑器' }
                // },
                // {
                //     // 图片上传组件
                //     path: '/upload',
                //     component: resolve => require(['../components/page/Upload.vue'], resolve),
                //     meta: { title: '文件上传' }
                // },
                // {
                //     // vue-schart组件
                //     path: '/charts',
                //     component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
                //     meta: { title: 'schart图表' }
                // },
                // {
                //     // 拖拽列表组件
                //     path: '/drag',
                //     component: resolve => require(['../components/page/DragList.vue'], resolve),
                //     meta: { title: '拖拽列表' }
                // },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../components/page/Permission.vue'], resolve),
                    meta: { title: '权限测试', permission: true }
                }
            ]
        },

        {
            path: '/',
            component: resolve => require(['../components/common/Home_admin.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard_admin',
                    component: resolve => require(['../components/page_admin/Dashboard_admin.vue'], resolve),
                    meta: { title: '后台管理系统首页' }
                },
                {
                    path: '/user_admin',
                    component: resolve => require(['../components/page_admin/user_admin.vue'], resolve),
                    meta: { title: '用户管理界面' }
                },
                {
                    path: '/images_admin',
                    component: resolve => require(['../components/page_admin/images_admin.vue'], resolve),
                    meta: { title: '镜像管理界面' }
                },
                {
                    path: '/container_admin',
                    component: resolve => require(['../components/page_admin/Container_admin.vue'], resolve),
                    meta: { title: '容器管理界面' }
                },
                {
                    path: '/volume_admin',
                    component: resolve => require(['../components/page_admin/volume_admin.vue'], resolve),
                    meta: { title: '数据卷管理界面' }
                },
                 {
                    path: '/log_admin',
                    component: resolve => require(['../components/page_admin/log_admin.vue'], resolve),
                    meta: { title: '日志管理界面' }
                },
                  {
                    // 富文本编辑器组件
                    path: '/editor_admin',
                    component: resolve => require(['../components/page_admin/VueEditor_admin.vue'], resolve),
                    meta: { title: '消息群发界面' }
                },
            ]
        },


                {
            path: '/login',
            component: resolve => require(['../components/page/login.vue'], resolve)
        },
        {
            path: '/register',
            component: resolve => require(['../components/page/Register.vue'], resolve)
        },
        {
            path: '/login_admin',
            component: resolve => require(['../components/page_admin/login_admin.vue'], resolve)
        },

        {
            path: '/index',
            component: resolve => require(['../components/Index/index.vue'], resolve)
        },
        {
            path: '/test',
            component: resolve => require(['../components/page/HomePage.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        // {
        //     path: '/403',
        //     component: resolve => require(['../components/page/403.vue'], resolve)
        // },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
